import React, { Component } from 'react'
import { Route } from 'react-router';
import { connect } from 'react-redux'

class homes extends Component {
 
  render() {
    const { navList } = this.props
    console.log(this.props);
    return (
      <div className="homes h100">
        <main>
          {/* {
            <Route path={this.props.children[0].path} component={() => {
              return <p>1</p>
            }}></Route>
          } */}
          
          {
            navList.map((item, index) => {
              return <p className={item.flag ? "block" : "none"} key={index} onClick={() => {
                this.props.history.push('/home/money/')
              }}> {item.title}</p>
            })
          }
        </main>
      </div>
    )
  }
}
//获取redux状态
const mapStateToProps = (state) => {

  return state
}

const mapDispatchToProps = (dispatch) => {
  return {}
}

export default connect(mapStateToProps, mapDispatchToProps)(homes)
